package com.ruoyi.channel.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.channel.mapper.ChannelMerchantsConfigMapper;
import com.ruoyi.channel.domain.ChannelMerchantsConfig;
import com.ruoyi.channel.service.IChannelMerchantsConfigService;

/**
 * 渠道类目配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-09
 */
@Service
public class ChannelMerchantsConfigServiceImpl implements IChannelMerchantsConfigService 
{
    @Autowired
    private ChannelMerchantsConfigMapper channelMerchantsConfigMapper;

    /**
     * 查询渠道类目配置
     * 
     * @param id 渠道类目配置主键
     * @return 渠道类目配置
     */
    @Override
    public ChannelMerchantsConfig selectChannelMerchantsConfigById(Long id)
    {
        return channelMerchantsConfigMapper.selectChannelMerchantsConfigById(id);
    }

    /**
     * 查询渠道类目配置列表
     * 
     * @param channelMerchantsConfig 渠道类目配置
     * @return 渠道类目配置
     */
    @Override
    public List<ChannelMerchantsConfig> selectChannelMerchantsConfigList(ChannelMerchantsConfig channelMerchantsConfig)
    {
        return channelMerchantsConfigMapper.selectChannelMerchantsConfigList(channelMerchantsConfig);
    }

    /**
     * 新增渠道类目配置
     * 
     * @param channelMerchantsConfig 渠道类目配置
     * @return 结果
     */
    @Override
    public int insertChannelMerchantsConfig(ChannelMerchantsConfig channelMerchantsConfig)
    {
        channelMerchantsConfig.setCreateTime(DateUtils.getNowDate());
        return channelMerchantsConfigMapper.insertChannelMerchantsConfig(channelMerchantsConfig);
    }

    /**
     * 修改渠道类目配置
     * 
     * @param channelMerchantsConfig 渠道类目配置
     * @return 结果
     */
    @Override
    public int updateChannelMerchantsConfig(ChannelMerchantsConfig channelMerchantsConfig)
    {
        channelMerchantsConfig.setUpdateTime(DateUtils.getNowDate());
        return channelMerchantsConfigMapper.updateChannelMerchantsConfig(channelMerchantsConfig);
    }

    /**
     * 批量删除渠道类目配置
     * 
     * @param ids 需要删除的渠道类目配置主键
     * @return 结果
     */
    @Override
    public int deleteChannelMerchantsConfigByIds(Long[] ids)
    {
        return channelMerchantsConfigMapper.deleteChannelMerchantsConfigByIds(ids);
    }

    /**
     * 删除渠道类目配置信息
     * 
     * @param id 渠道类目配置主键
     * @return 结果
     */
    @Override
    public int deleteChannelMerchantsConfigById(Long id)
    {
        return channelMerchantsConfigMapper.deleteChannelMerchantsConfigById(id);
    }
}
